﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using Digitalmes.Model.EquipmentManagement;
using Digitalmes.Model;

namespace Digitalmes.ViewModel.EquipmentManagement.MaintenancePlanVMs
{
    public partial class MaintenancePlanTemplateVM : BaseTemplateVM
    {
        
        [Display(Name = "_Model._MaintenancePlan._PlanName")]
        public ExcelPropety PlanName_Excel = ExcelPropety.CreateProperty<MaintenancePlan>(x => x.PlanName);
        [Display(Name = "_Model._MaintenancePlan._Equipment")]
        public ExcelPropety Equipment_Excel = ExcelPropety.CreateProperty<MaintenancePlan>(x => x.EquipmentId);
        [Display(Name = "_Model._MaintenancePlan._EquipmentName")]
        public ExcelPropety EquipmentName_Excel = ExcelPropety.CreateProperty<MaintenancePlan>(x => x.EquipmentName);
        [Display(Name = "_Model._MaintenancePlan._PlanType")]
        public ExcelPropety PlanType_Excel = ExcelPropety.CreateProperty<MaintenancePlan>(x => x.PlanType);
        [Display(Name = "_Model._MaintenancePlan._IntervalDays")]
        public ExcelPropety IntervalDays_Excel = ExcelPropety.CreateProperty<MaintenancePlan>(x => x.IntervalDays);
        [Display(Name = "_Model._MaintenancePlan._NextDueDate")]
        public ExcelPropety NextDueDate_Excel = ExcelPropety.CreateProperty<MaintenancePlan>(x => x.NextDueDate, true);
        [Display(Name = "_Model._MaintenancePlan._IsActive")]
        public ExcelPropety IsActive_Excel = ExcelPropety.CreateProperty<MaintenancePlan>(x => x.IsActive);
        [Display(Name = "_Model._MaintenancePlan._CreateTime")]
        public ExcelPropety CreateTime_Excel = ExcelPropety.CreateProperty<MaintenancePlan>(x => x.CreateTime, true);
        [Display(Name = "_Model._MaintenancePlan._UpdateTime")]
        public ExcelPropety UpdateTime_Excel = ExcelPropety.CreateProperty<MaintenancePlan>(x => x.UpdateTime, true);
        [Display(Name = "_Model._MaintenancePlan._CreateBy")]
        public ExcelPropety CreateBy_Excel = ExcelPropety.CreateProperty<MaintenancePlan>(x => x.CreateBy);
        [Display(Name = "_Model._MaintenancePlan._UpdateBy")]
        public ExcelPropety UpdateBy_Excel = ExcelPropety.CreateProperty<MaintenancePlan>(x => x.UpdateBy);
        [Display(Name = "_Model._MaintenancePlan._IsValid")]
        public ExcelPropety IsValid_Excel = ExcelPropety.CreateProperty<MaintenancePlan>(x => x.IsValid);
        [Display(Name = "_Model._MaintenancePlan._TenantCode")]
        public ExcelPropety TenantCode_Excel = ExcelPropety.CreateProperty<MaintenancePlan>(x => x.TenantCode);

	    protected override void InitVM()
        {
            
            Equipment_Excel.DataType = ColumnDataType.ComboBox;
            Equipment_Excel.ListItems = DC.Set<Equipment>().GetSelectListItems(Wtm, y => y.ID.ToString().ToString());

        }

    }

    public class MaintenancePlanImportVM : BaseImportVM<MaintenancePlanTemplateVM, MaintenancePlan>
    {
            //import

    }

}